<!DOCTYPE html>
<html>

<head>
  <title></title>
  <script type="text/javascript">
  //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
  const object1 = { foo: 'bar', baz: 42 };
  console.log(Object.entries(object1)[1]);

  const object2 = { 0: 'a', 1: 'b', 2: 'c' };
  console.log(Object.entries(object2)[2]);


  // iterate through key-value gracefully
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
  const obj = { a: 5, b: 7, c: 9 };
  for (const [key, value] of Object.entries(obj)) {
    console.log(`${key} ${value}`); // "a 5", "b 7", "c 9"
  }

  // Or, using array extras
  Object.entries(obj).forEach(([key, value]) => {
    console.log(`${key} ${value}`); // "a 5", "b 7", "c 9"
  });
  </script>
</head>

<body>
</body>

</html>